home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_bab_crushblock.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  132 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEO_CrossBlocks.cog
  4. #
  5. # Crushing Block script
  6. #
  7. # [SXC]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14.     message     startup
  15.     message     entered
  16.     message     exited
  17.  
  18.     surface     trigger_surf       mask=0x400
  19.     sound       clicksound
  20.     sound       slidesound=shw_grill_move.wav
  21.     sound       crushsound
  22.     sound       stopsound=shw_grill_stop.wav
  23.     sound       sndstop=gen_stone_stop_c.wav
  24.         
  25.     thing        crushblock0     linkid=0 mask=0x405
  26.     thing       crushblock1     linkid=0 mask=0x405
  27.     thing       player0         local
  28.     thing       deadIndy        local
  29.     thing       crushcam0
  30.     
  31.     template    temDeadIndy=indy_sh_actor   local
  32.     keyframe    deathKeyAnim=in_die_buckle.key  local
  33.  
  34.     flex        moveSpeed=10.0
  35.         
  36.     int         resettime=3.0
  37.     int         soundthing      local
  38.     int         crushlock=0     local
  39.     int         clicklock       local
  40.     int         damagecheck=0   local
  41.     int         killflag        local
  42.  
  43. end
  44.  
  45. # ========================================================================================
  46.  
  47. code
  48.  
  49. # ........................................................................................
  50. startup:
  51.  
  52.     player0 = GetLocalPlayerThing();
  53.     
  54. return;
  55.     
  56. # ........................................................................................
  57. entered:
  58.  
  59.     killflag = 1;
  60.     if ((GetSenderRef() == trigger_surf) && (clicklock == 0))
  61.     {
  62.         clicklock = 1;
  63.         PlaySoundLocal(clicksound, 1, 0, 0x0, 0);
  64.         Sleep(0.5);
  65.         MoveToFrame(crushblock0, 1, moveSpeed);   
  66.         MoveToFrame(crushblock1, 1, moveSpeed);
  67.         PlaySoundLocal(crushsound, 1, 0, 0x0, 0);
  68.         
  69.         if ((GetMoveStatus(player0) >= 3) &&
  70.             (GetMoveStatus(player0) <= 5))
  71.             {
  72.                 Sleep(1);
  73.                 MoveToFrame(crushblock0, 0, (moveSpeed/4));
  74.                 MoveToFrame(crushblock1, 0, (moveSpeed/4));
  75.                 WaitforStop(crushblock0);
  76.                 PlaySoundThing(sndstop, crushblock1, 1, 1, 8, 0x80);
  77.                 Sleep(1);
  78.                 clicklock = 0;
  79.                 return;
  80.             }
  81.             
  82.         if (killflag == 0)
  83.             {
  84.                 Sleep(1);
  85.                 MoveToFrame(crushblock0, 0, (moveSpeed/4));
  86.                 MoveToFrame(crushblock1, 0, (moveSpeed/4));
  87.                 WaitforStop(crushblock0);
  88.                 PlaySoundThing(sndstop, crushblock1, 1, 1, 8, 0x80);
  89.                 Sleep(1);
  90.                 clicklock = 0;
  91.                 return;
  92.             }
  93.             
  94.         if (killflag == 1)
  95.         {
  96.         
  97.             //print("Damaging Indy");                            
  98.             DamageThing(player0, 1000, 0x1, crushblock0);
  99.             SetThingFlags(player0, 0x80000);
  100.             deadIndy = CreateThing(temDeadIndy, player0);
  101.             CaptureThing(deadIndy);
  102.             CopyPlayerHolsters(player0, deadIndy);
  103.             ClearThingFlags(deadIndy, 0x80000);
  104.             SetCameraFocus(2, crushcam0);
  105.             SetCameraSecondaryFocus(2, deadIndy);
  106.             SetCurrentCamera(2);
  107.             Sleep(0.5);
  108.             PlayKey(deadIndy, deathKeyAnim, 4, 0x14, 0);
  109.             Sleep(1);
  110.             MoveToFrame(crushblock0, 0, (moveSpeed/4));
  111.             MoveToFrame(crushblock1, 0, (moveSpeed/4));
  112.             WaitforStop(crushblock0);
  113.             PlaySoundThing(sndstop, crushblock1, 1, 1, 8, 0x80);
  114.             Sleep(1);
  115.             clicklock = 0;
  116.         }
  117.     }
  118.     
  119. return;                
  120.  
  121. # ........................................................................................
  122. exited:
  123.     
  124.     killflag = 0;
  125.     
  126. return;
  127.  
  128. # ........................................................................................
  129.                 
  130. end
  131.  
  132.